@extends('admin.common.common')

@section('head')

@endsection


@section('body')

    <article class="page-container">

        <form class="form form-horizontal" id="form-role-add" action="{{route('admin.user.role',$user)}}" method="post" enctype="multipart/form-data">
            @csrf
            @if ($errors->any())
                <div class="Huialert-error Huialert">
                    <ul>
                        @foreach ($errors->all() as $error)
                            <li>{{ $error }}</li>
                        @endforeach
                    </ul>
                </div>
            @endif

            @foreach($data as $val)
                <div class="row cl">
                    <div class="formControls col-xs-8 col-sm-9">
                        <input type="radio" name="ids" value="{{$val->id}}"
                               @if($userRole == $val->id ) checked @endif
                        >
                        &nbsp;&nbsp{{$val->rolename}}
                    </div>
                </div>
            @endforeach
            <div class="row cl">
                <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                    <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
                </div>
            </div>
        </form>
    </article>
@endsection


@section('js')
    <script src="/admin/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
    <script  src="/admin/lib/jquery.validation/1.14.0/messages_zh.js"></script>
@endsection
